package com.enation.app.shop.front.policyInsurance.area.service;

import com.enation.app.shop.front.policyInsurance.area.entity.Province;
import com.enation.framework.database.IDaoSupport;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service("provinceService")
public class ProvinceService implements ProvinceManager {
    @Autowired
    private IDaoSupport daoSupport;
    @Override
    public List<Province> getAll() {
        String sql="select * from hat_province";
        return this.daoSupport.queryForList(sql,Province.class);
    }

    @Override
    public Province getById(String pid) {
        String sql="select * from hat_province where provinceId=?";
        return this.daoSupport.queryForObject(sql,Province.class,pid);
    }
}
